<SCRIPT LANGUAGE="JavaScript"> 
    var xx = 100;
    var yy = 100;
    var tx = 0;
    var ty = 0;
    var dx = 0;
    var dy = 0;
    var klik = 0;

    function make_slip(event)
    {  
        if(event)
        {
            xx=event.clientX;
            yy=event.clientY;
        }
        else
        {
            xx=100;
            yy=100;
        }
        klik=0;
        
        var temp = document.getElementById('slip');
        temp.style.position = 'absolute';
        temp.style.borderTop = '4px solid #ddd';
        temp.style.borderLeft = '4px solid #ddd';
        temp.style.borderBottom = '4px solid #aaa';
        temp.style.borderRight = '4px solid #aaa';
            
        temp.style.top = yy+'px';
        temp.style.left = xx+'px';
        temp.style.width = 'auto';
        temp.style.height = 'auto';
        temp.style.backgroundColor = 'white';    
        tampil();
    }
    
    function close_slip()
    {  
        document.getElementById('slip').innerHTML = '';
        document.getElementById('slip').style.border = 'none';
    }
    
    function tekan(event)
    {
        klik = 1;
        tx=event.clientX;
        ty=event.clientY;
    }
    
    function gerak(event)
    {
        if(klik==1)
        {
            dx=event.clientX-tx;
            dy=event.clientY-ty;
            
            xx = xx + dx;
            yy = yy + dy;
            
            document.getElementById('slip').style.top = yy+'px';
            document.getElementById('slip').style.left = xx+'px';      
            
            tx=event.clientX;
            ty=event.clientY;
        }
    }    
    
    function lepas()
    {
        klik=0;
    }
  
    function gocover()
    {
        if (confirm('Are you sure you want to continue the action ?\nIf you think the template is not suitable for you, you can undo the change at the editor.'))
        {
            var isi=document.getElementById('company_name').value+"\n<br>\n<br>"+document.getElementById('now').value+"\n<br>\n<br>To Whom It May Concern:\n<br>Application for the position of "+document.getElementById('position').value+" \n<br>I am interested in applying for the above position advertised in ITjobz.com on "+document.getElementById('created').value+". My resume is attached for your review.\n<br>I am confident that my skills and past experience could make great contributions to your organization. Therefore I would appreciate the opportunity to discuss my qualifications for this position in greater detail with you in person at your earliest convenience.\n<br>Thank you for your consideration and I look forward to hearing from you.\n<br>\n<br> Yours sincerely,\n<br>\n<br>"+document.getElementById('first_name').value+" "+document.getElementById('last_name').value;
            document.getElementById('ApplicantCover').value=isi;
        }
    }

    function open_win2(id)
    {
        window.open('../jobs/view/'+id,"_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, top=100, left=100, width=930, height=600");
    }    
    
    function open_win(id)
    {
        window.open('../employers/view/'+id,"_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, top=100, left=100, width=930, height=600");
    }
  
</SCRIPT>
   
<?php          
   echo "<div class='form'>"; 
   echo "<h2> Jobs Alert Result </h2>";
   echo "<hr color='#2A7EF7'>"; 

    if(!empty($jobs))
    {    
        echo $this->element('myfunction'); 
        
        echo ":. Asistensi Anda telah menemukan <b>".count($jobs)."</b> Lowongan(s) yang cocok untuk profil asistensi Anda";
        echo "<br>";
        
        if(count($jobs)>0)
        {
            echo "<table class='jobs' cellpadding=0 cellspacing=0>";
                echo "<tr><th width='100px'>Posted Date</th><th width='220px'>Position</th><th width='150px'>Company Name</th><th width='120px'>Location</th><th width='100px'>Career Level</th><th width='80px'>Year Exp</th><th width='120px'>Salary</th><th width='120px'>Action</th></tr>";
                foreach($jobs as $job)
                {
                    echo "<tr>";
                    echo "<td>".mydate($job['jobs']['created'])."</td>";
                    echo "<td> <a href='javascript:open_win2(".$job['jobs']['id'].")' class='sky'>".$job['jobs']['position']."</a> &nbsp";
                    echo $ajax->link("<img src='../img/hint.gif'>",
                                    array('controller'=>'jobs','action'=>'detail',$job['jobs']['id']),
                                    array('update'=>'slip','complete'=>"make_slip(event);"),
                                    null,false
                                    
                                 ); 
                    echo "</td>";
                    echo "<td><a href='javascript:open_win(".$job['employers']['id'].")'>".$job['employers']['company_name']."</a></td>";
                    echo "<td>".$job['cities']['name']."</td>"; 
                     
                    if($job['jobs']['entry']==1)
                    echo "<td>Entry Level</td>";
                    if($job['jobs']['middle']==1)
                    echo "<td>Middle</td>";
                    if($job['jobs']['senior']==1)
                    echo "<td>Senior</td>";
                    if($job['jobs']['top']==1)
                    echo "<td>Top</td>";

                    echo "<td>".$job['jobs']['experience']."</td>";

                    if($job['jobs']['salary']==0)
                    { $temp=SALARY_0; }
                    if($job['jobs']['salary']==1)
                    { $temp=SALARY_1; }
                    if($job['jobs']['salary']==2)
                    { $temp=SALARY_2; }
                    if($job['jobs']['salary']==3)
                    { $temp=SALARY_3; }
                    if($job['jobs']['salary']==4)
                    { $temp=SALARY_4; }
                    echo "<td>".$temp."</td>";
                    
                    echo "<td>".$ajax->link('[ Apply ]', array('controller'=>'applicants','action'=>'apply_ajax',$job['jobs']['id']), array('update'=>'slip','complete'=>"make_slip();"));
                    echo " &nbsp".$html->link("<img src='../img/clipboard2.gif'>", array('controller'=>'clipboards','action'=>'save',$job['jobs']['id']),array(),false,false);
                    echo "</td>";
                    //echo "<td>".$html->link('[ Apply ]',array('controller'=>'applicants','action'=>'apply',$job['jobs']['id']))."</td>";
                    echo "</tr>";
                }
            echo "</table>";
            echo "<br>";
			?>
			<table class='jobs' cellpadding=0 cellspacing=0>
				<tr>
					<th><div id="results" class="job"><a id="header-text">Position</a><span class="company_location">Location</span></div></th>
				</tr>
				<tr>
					<td style="border:none;"><div id='indJobContent' class=""></div></td>
				<tr>
			</table>
			<?php
        }

    }
    else
    {
        echo "<span class='red'> &nbsp &nbsp Sorry, your assitant cann't find any jobs </span>, maybe you assistant's profile too restricted ".$html->link('[ Edit ]',array('controller'=>'assistants','action'=>'index'));
    }
    echo "</div>";
    echo "<div id='slip'></div>";
?>
<style>
#header-text{
	text-decoration:none;
	font-weight:bold;
}
#header-text:hover{
	color:#000000;
	cursor:default;
}
.company_location{font-size: 11px;overflow: hidden;display:block;float:left;width:300px;}
.job a{display:block;float:left;overflow: hidden;width:300px;}
#indJobContent .company_location{font-size: 11px;overflow: hidden;display:block;float:left;width:300px;border-bottom:dashed #eee;}
#indJobContent .job a{display:block;float:left;overflow: hidden;width:300px;border-bottom:dashed #eee;}
#results{width:600px;}
#results br{
	display:none;
}
</style>
<?php
// echo $this->Session->read("User.id");
// $query	= mysql_query("SELECT name FROM jobseeker_skills JOIN skills ON skills.id = jobseeker_skills.skill_id WHERE jobseeker_id = '1'");
// while($row=mysql_fetch_array($query)){
	// echo "oke";
// }
?>
<script type='text/javascript'>
var ind_pub = '1558143262802194';
var ind_el = 'indJobContent';
var ind_pf = '';
var ind_q = 'IT';
var ind_l = '';
var ind_chnl = 'none';
var ind_n = 15;
var ind_d = 'http://id.indeed.com';
var ind_t = 40;
var ind_c = 30;
</script>
<script type='text/javascript' src='http://id.indeed.com/ads/jobroll-widget-v3.js'></script>
<?php
$isi	= file_get_contents("E:xampp/htdocs/it-jobz/data.html");
// echo $isi;
mysql_query("INSERT INTO job_apis (isi) VALUES ('" . $isi . "') ");
?>